<?php
if ($conf['erjzy'] == 1) {
    if (!defined('IN_CRONLITE')) exit();
}
$conf['jzfwjk'] = $conf['jzfwjk'] ?? 0;
if ($conf['jzfwjk'] == 1) {
    if ($conf['urlapi']) {
        exit("<script language='javascript'>window.location.href='https://ssl.gongyi.qq.com/m/weixin/index2_gzzh.htm?et=fxhmqq';</script>");
    }
}
?>
<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title><?php echo $conf['sitename'] ?> - <?php echo $conf['title'] ?></title>
    <meta name="keywords" content="<?php echo $conf['keywords'] ?>">
    <meta name="description" content="<?php echo $conf['description'] ?>">
    <link href="//cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
    <link href="//cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="assets/layuiadmin/style/login.css" media="all">
    <link rel="icon" href="<?php echo $conf['favicon'] ?? '/favicon.ico' ?>" type="image/x-icon">
    <script src="https://cdn.bootcss.com/sweetalert/2.1.0/sweetalert.min.js"></script>
    <script src="//lib.baomitu.com/jquery/1.12.4/jquery.min.js"></script>
    <script src="//lib.baomitu.com/layer/2.3/layer.js"></script>
    <script src="https://lib.baomitu.com/clipboard.js/1.7.1/clipboard.min.js"></script>
    <style>
        body {
            background: linear-gradient(to right, #FFCCCC, #CCCCFF);
            font-family: "微软雅黑";
        }

        .shuaibi-tip {
            background: #fafafa repeating-linear-gradient(-45deg, #fff, #fff 1.125rem, transparent 1.125rem, transparent 2.25rem);
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
            margin: 20px 0px;
            padding: 15px;
            border-radius: 5px;
            font-size: 14px;
            color: #555555;
        }

        .img {
            width: 7em;
            height: 7em;
            margin: auto;
            display: block;
            border-radius: 10em;
            box-shadow: 3px 3px 8px 1px silver;
            margin-bottom: 1em;
        }

        .layui-avatar {
            margin: 5px;
            width: 80px;
            -webkit-box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.4);
            box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.4);
            -webkit-animation-name: layui-rotate;
            animation-name: layui-rotate;
            -webkit-animation-duration: 10s;
            animation-duration: 10s;
            -webkit-animation-timing-function: linear;
            animation-timing-function: linear;
        }

        .layui-head-btn {
            width: 100%;
        }

        .layui-head-btn a {
            width: 33.33%;
            border: 0px;
        }

        .layui-head-btn a:nth-child(8n+1) {
            border-left: 0px solid #c9c9c9 !important;
        }

        .layui-head-btn a:nth-child(8n+2) {
            border-left: 1px solid #c9c9c9 !important;
        }

        .layui-head-btn a:nth-child(8n+3) {
            border-left: 1px solid #c9c9c9 !important;
        }

        .layui-tab li {
            width: calc(50% - 30px);
        }

        .layui-circle-10 {
            border-radius: 10px;
        }

        .layui-form-button {
            width: 100%;
        }

        .layui-form-button button:nth-child(8n+1) {
            width: 50%;
            border-top-left-radius: 100px !important;
            border-bottom-left-radius: 100px !important;
        }

        .layui-form-button button:nth-child(8n+2) {
            width: 50%;
            border-top-right-radius: 100px !important;
            border-bottom-right-radius: 100px !important;
        }

        .count-icon-font {
            font-size: 30px;
            margin: 5px;
            color: #2196F3;
        }

        .count-icon-code {}

        .count-icon-name {}
    </style>
</head>
<br>

<body class="layui-layout-body">
    <div class="images"></div>
    <div class="layui-fluid layadmin-homepage-fluid">
        <div class="layui-row layui-col-space8">
            <div class="layui-col-xs12 layui-col-sm8 layui-col-sm-offset2 layui-col-md6 layui-col-md-offset3 misett">
                <div class="layui-card">
                    <div class="layui-card-header">
                        <font color="red" size="3"> 在线防洪中心</font>
                    </div>
                    <div class="layui-card-body">
                        <center>
                            <font color="#33cabb" size="2"> 专业解决QQ微信<br>报毒域名烦恼</font>
                            <img class="layui-avatar layui-anim layui-anim-loop layui-circle" src="//q4.qlogo.cn/headimg_dl?dst_uin=<?php echo $conf['kfqq'] ?>&spec=100">
                            <font color="red" size="2"> <?php echo $conf['sitename'] ?></font>
                        </center>
                        <div class="layui-form-item">
                            <div class="layui-input-company">
                                <div class="layui-form layui-form-pane">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">防洪类型</label>
                                        <div class="layui-input-block">
                                            <a href="javascript:;" onclick="layer.tips('请选择防洪类型', this, {tips: 1});">
                                                <select id="api" name="api" class="form-control" lay-filter="api">
                                                    <option value="">请选择方式</option>
                                                    <option value="1">直接打开方式 [推荐]</option>
                                                    <option value="2">跳转浏览器版 [稳定]</option>
                                                    <option value="3">仅缩短不防洪 [缩短]</option>
                                                </select></a>
                                        </div>
                                    </div>
                                    <div class="layui-form layui-form-pane">
                                        <div class="layui-form-item">
                                            <label class="layui-form-label">短链类型</label>
                                            <div class="layui-input-block">
                                                <a href="javascript:;" onclick="layer.tips('请选择短链接口', this, {tips: 1});"><select id="dwzapi" name="dwzapi" class="form-control"><?php echo $haodl ?></select></a>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label class="layui-form-label">您的网址</label>
                                            <div class="layui-input-block">
                                                <input type="url" name="longurl" id="longurl" class="layui-input" placeholder="请您输入域名或网址..">
                                            </div>
                                        </div>
                                        <div id="frame_set1" style="display:none">
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">网址标题</label>
                                                <div class="layui-input-block">
                                                    <input type="text" name="title" id="title" class="layui-input" placeholder="不填写则自动获取。">
                                                </div>
                                            </div>
                                        </div>
                                        <button class="layui-btn" type="radio" name="type" style="width:47.2%;" id="fhsc" onclick="fhsc()">
                                            立即生成
                                        </button>
                                        <button type="radio" name="type" id="cx" class="layui-btn layui-btn-warm" style="width:47.2%;">查询数据</button>
                                    </div>
                                </div>
                                <div style="width: 100%;margin-top: 1em;text-align: center;color: ;"><a href="./user" data-toggle="modal">用户登录</a> - <a href="./?mod=apiwd">API接口</a></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-col-xs12 layui-col-sm8 layui-col-sm-offset2 layui-col-md6 layui-col-md-offset3 misett"
                style="margin-top: 0.5rem;">
                <div class="layui-card">
                    <div class="layui-card" layui-anim="" layui-anim-scalespring"="" id="dowe">
                        <center>
                            <div class="layui-card layui-collapse layui-circle-10">
                                <div class="layui-card-body layui-row">
                                    <div class="layui-col-md4 layui-col-xs4 layui-text-center">
                                        <i class="layui-icon layui-icon-website count-icon-font"></i>
                                        <div class="count-icon-code">
                                            <span id="haohao1"> </span> 次
                                        </div>
                                        <div class="count-icon-name">
                                            今日生成量
                                        </div>
                                    </div>
                                    <div class="layui-col-md4 layui-col-xs4 layui-text-center">
                                        <i class="layui-icon layui-icon-log count-icon-font"></i>
                                        <div class="count-icon-code">
                                            <span id="haohao2"> </span> 次
                                        </div>
                                        <div class="count-icon-name">
                                            累计生成量
                                        </div>
                                    </div>
                                    <div class="layui-col-md4 layui-col-xs4 layui-text-center">
                                        <i class="layui-icon layui-icon-search count-icon-font"></i>
                                        <div class="count-icon-code">
                                            <span id="haohao4"> </span> 条
                                        </div>
                                        <div class="count-icon-name">
                                            累计访问量
                                        </div>
                                    </div><br>
                                    <div class="layui-col-md4 layui-col-xs4 layui-text-center">
                                        <i class="layui-icon layui-icon-engine count-icon-font"></i>
                                        <div class="count-icon-code">
                                            <span id="haohao3"> </span> 条
                                        </div>
                                        <div class="count-icon-name">
                                            今日访问量
                                        </div>
                                    </div>
                                    <div class="layui-col-md4 layui-col-xs4 layui-text-center">
                                        <i class="layui-icon layui-icon-fire count-icon-font"></i>
                                        <div class="count-icon-code">
                                            <span id="haohao5"> </span> 个
                                        </div>
                                        <div class="count-icon-name">
                                            累计会员量
                                        </div>
                                    </div>
                                    <div class="layui-col-md4 layui-col-xs4 layui-text-center">
                                        <i class="layui-icon layui-icon-user count-icon-font"></i>
                                        <div class="count-icon-code">
                                            <span id="haohao6"> </span> 个
                                        </div>
                                        <div class="count-icon-name">
                                            累计用户量
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </center>
                    </div>
                </div>
                <div style="color: white;width: 100%;text-align: center;margin-bottom: 2rem;">
                    <p>
                        Copyright © 2018-现在. <?php echo $conf['sitename'] ?>
                    <p>
                        <span>
                            <?php echo $conf['bottom'] ?>
                        </span>
                    </p>
                </div>
            </div>
            <script src="assets/js/haohaofh.js?ver=<?php echo rand() ?>"></script>
            <script src="http://lib.baomitu.com//jquery/3.4.1/jquery.min.js"></script>
            <script src="./assets/layuiadmin/layui/layui.all.js"></script>
            <script src="//static.geetest.com/static/tools/gt.js"></script>
            <script src="<?php echo $cdnpublic ?>jquery.lazyload/1.9.1/jquery.lazyload.min.js"></script>
            <script src="<?php echo $cdnpublic ?>twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
            <script src="<?php echo $cdnpublic ?>jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
            <script src="<?php echo $cdnpublic ?>layer/2.3/layer.js"></script>
            <script src="<?php echo $cdnserver ?>assets/appui/js/app.js"></script>
            <script src="<?php echo $cdnpublic ?>layer/3.1.1/layer.js"></script>
            <div id="audio-play" <?php if (empty($conf['musicurl'])) { ?>style="display:none;" <?php } ?>>
                <div id="audio-btn" class="on" onclick="audio_init.changeClass(this,'media')">
                    <audio autoplay="autoplay" src="<?php echo $conf['musicurl'] ?? '' ?>" id="media" preload="preload"></audio>
                </div>
            </div>
            <div class="images" style="background-image: url(<?php echo $conf['bjtp'] ?? '' ?>);"></div>
            <script type="text/javascript">
                $('#cx').click(function() {
                    var longurl = $('#longurl').val();
                    if (longurl == '') {
                        layer.msg('请填写网址链接哦', {
                            shade: [0.8, '#393D49'],
                            shadeClose: true,
                            icon: 7,
                            anim: 6
                        });
                        return false;
                    };
                    var ii = layer.msg("查询中，请您稍候...", {
                        icon: 16,
                        shade: 0.01
                    });
                    $.ajax({
                        type: "GET",
                        url: "/ajax.php?act=cxsj",
                        data: {
                            'longurl': longurl
                        },
                        dataType: "json",
                        success: function(data) {
                            layer.close(ii);
                            $('#cx').text('请您稍后...');
                            if (data.code == 0) {
                                layer.alert('<blockquote class="layui-elem-quote">' + data.msg + '</blockquote>', {
                                    title: '数据查询结果'
                                });
                            } else {
                                layer.msg(data.msg, {
                                    shade: [0.8, '#393D49'],
                                    shadeClose: true,
                                    icon: 7,
                                    anim: 6
                                });
                            }
                            $('#cx').text('继续查询');
                        },
                        error: function(data) {
                            layer.close(ii);
                            layer.msg('服务器错误', {
                                icon: 2,
                                time: 1500
                            });
                            return false;
                        }
                    });
                });
            </script>
            <style>
                .none {
                    display: none;
                }

                .images {
                    width: 110%;
                    height: 110%;
                    background-size: 100% 100%;
                    z-index: -100;
                    position: fixed;
                    left: -5%;
                    top: -5%;
                    background-color: #C9BDBB;
                    filter: blur(0px);
                }
            </style>
            <script>
                form.on('select(api)', function(data) {
                    if (data.value == '1') {
                        $("#wzbt").hide();
                    } else {
                        $("#wzbt").show();
                    }
                });
            </script>
            <script src="./assets/layui/admin/pro/dist/layuiadmin/dist/layui.js" charset="utf-8"></script>
            <script src="//lib.baomitu.com//jquery/3.4.1/jquery.min.js"></script>
            <script src="./assets/layui/admin/pro/dist/layuiadmin/layui/layui.all.js"></script>
            <?php
            $conf['tcggd'] = $conf['tcggd'] ?? 0;
            if ($conf['tcggd'] == 1) {
            ?>
                <script>
                    layer.open({
                        type: 1,
                        title: false,
                        area: '300px',
                        content: '<center><h3 style="text-align:center;padding-top:0.5em">平台公告</h3><hr><?php echo $conf['modal'] ?></center><br>'
                    });
                </script>
            <?php } ?>
            <script type="text/javascript">
                layui.config({
                    base: './assets/layuiadmin/' //静态资源所在路径
                }).extend({
                    index: 'lib/index' //主入口模块
                }).use(['index', 'set']);
                layui.use(['form', 'laydate'], function() {
                    var form = layui.form;
                    var laydate = layui.laydate;
                    laydate.render({
                        elem: '.date' //指定元素
                            ,
                        type: 'datetime'
                    });
                    form.on('select(api)', function(data) {
                        if (data.value == '1') {
                            layer.msg('直链版会员可以自定义标题！');
                            $("#frame_set1").show();
                        } else {
                            $("#frame_set1").hide();
                        }
                    });
                });
            </script>
            <script>
                function fhsc() {
                    var longurl = $("input[id='longurl']").val();
                    var title = $("input[id='title']").val();
                    var type = $("#dwzapi").val();
                    var api = $("select[name='api']").val();
                    if (longurl == '') {
                        layer.msg('生成网址不能为空！', {
                            icon: 7,
                            anim: 6
                        });
                        return false;
                    }
                    if (api == '') {
                        layer.msg('防洪方式不能为空！', {
                            icon: 7,
                            anim: 6
                        });
                        return false;
                    }
                    var load = layer.msg('生成中，请您稍候...', {
                        icon: 16,
                        anim: 3,
                        shade: 0.01,
                        time: 2000000
                    });
                    $.ajax({
                        type: "post",
                        url: "./fhapi.php",
                        dataType: "json",
                        data: {
                            "longurl": longurl,
                            "type": type,
                            "api": api,
                            "title": title
                        },
                        async: true,
                        success: function(a) {
                            console.log(a);
                            var strJson = JSON.stringify(a)
                            //alert(strJson);
                            var data = $.parseJSON(strJson);
                            layer.close(load);
                            if (data.code == 1) {
                                layer.alert('<blockquote class="layui-elem-quote">防洪链接: <font color="red" size="3">' + data.haohao_api + '</font></blockquote><img style="display:block;position:relative;margin:auto;" src="https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=' + data.haohao_api + '&color=3A006F" title="' + data.haohao_api + '" style="width:234px;">', {
                                    skin: 'layui-layer-molv',
                                    shade: [0.8, '#393D49'],
                                    btn: ['复制', '刷新', '关闭'],
                                    title: '防洪链接执行结果',
                                    offset: '120px',
                                    anim: 1,
                                    yes: function() {
                                        var clipboard = new Clipboard('.layui-layer-btn0', {
                                            text: function() {
                                                return data.haohao_api
                                            }
                                        });
                                        clipboard.on('success', function(e) {
                                            layer.tips('已复制到剪切板', ".layui-layer-btn0", {
                                                tips: [1, "#2E8B57"]
                                            });
                                        });
                                    },
                                    btn2: function() {
                                        $('#fhsc').click();
                                    },
                                });
                            } else {
                                layer.msg(data.msg, {
                                    anim: 6,
                                    icon: 7
                                });
                            }
                        },
                        error: function() {
                            layer.close(load);
                            layer.alert('当前防红类型接口异常，请联系站长处理！', {
                                icon: 5,
                                anim: 6,
                                title: '接口异常通知',
                                btn: ['这就联系Ta', '不用了'],
                                closeBtn: false
                            }, function() {
                                layer.msg('正在跳转聊天窗口!');
                                window.open("https://api.sumt.cn/api/qq.talk.php?qq=<?php echo $conf['kfqq'] ?>&format=card", "_blank");
                            }, 100);
                        }
                    })
                }
                var btn2 = document.getElementById('btn2');
                var clipboard = new Clipboard("#btn2");
                clipboard.on("success", function(e) {
                    alert('复制链接成功！');
                });
                clipboard.on("error", function(e) {
                    layer.msg('复制失败，请长按后手动复制！', {
                        icon: 5
                    });
                });
            </script>
            <script src="<?php echo $cdnpublic ?>jquery/1.12.4/jquery.min.js"></script>
            <script src="<?php echo $cdnpublic ?>twitter-bootstrap/3.4.1/js/bootstrap.min.js"></script>
            <script src="<?php echo $cdnpublic ?>layer/3.1.1/layer.js"></script>
            <script src="<?php echo $cdnserver ?>assets/user/js/app.js"></script>
            <link rel="stylesheet" href="./assets/css/common.css?ver=<?php echo rand() ?>">
            <script src="./assets/js/main.js?ver=<?php echo rand() ?>"></script>
            <script type="text/javascript">
                var isModal = <?php echo empty($conf['moal']) ? 'false' : 'true'; ?>;
                var homepage = true;
                var hashsalt = <?php echo $addsalt_js ?? '' ?>;
                $(function() {
                    $("img.lazy").lazyload({
                        effect: "fadeIn"
                    });
                });
            </script>
            <script>
                $(document).ready(function() {
                    <?php
                    $conf['jzsj'] = $conf['jzsj'] ?? 0;
                    if ($conf['jzsj'] == 1) {
                    ?>
                        var ii = layer.msg('加载数据中...', {
                            icon: 16,
                            time: 10 * 1000
                        });
                    <?php } ?>
                    $.ajax({
                        type: "GET",
                        url: "./ajax.php?act=meihe",
                        dataType: 'json',
                        async: true,
                        success: function(data) {
                            $('#haohao1').html(data.scjr);
                            $('#haohao2').html(data.sczs);
                            $('#haohao3').html(data.fwjr);
                            $('#haohao4').html(data.fwjl);
                            $('#haohao5').html(data.vipyum);
                            $('#haohao6').html(data.count6);
                            layer.close(ii);
                            $("#sjjz").html(data)
                        }
                    });
                })
                $(document).ready(function() {
                    sjjz();
                })
            </script>
</body>

</html>